package szoftlab4sunak;

import java.awt.Color;
import java.awt.Graphics;

public class VTrap implements VBattleDevice {
	
	private Trap ownTrap;					//Taroljuk a Trap amihez tartozik a VTrap
	private int x;							//X koordinata
	private int y;							//Y koordinata
	private Color color = Color.black;		//Szin tarolasa
	@Override
	
	//Kirajzolas
	public void draw(Graphics g) {
		//Stone eseten megfelelo szin beallitasa
		if (ownTrap.haveStone())
			g.setColor(Color.cyan);		
		else
			g.setColor(color);
		
		//Kereszt kirajzolasa
		x = ownTrap.getPosx();
		y = ownTrap.getPosy();
		g.drawLine(x, y, x + 100, y + 100);
		g.drawLine(x + 100, y, x, y + 100);
	}
	//A VTrap-hez tartozo Trap beallitasa
	public void setOwnTower(Trap ownTrap) {
		this.ownTrap = ownTrap;
	}
	

}
